/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkg_entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Oswaldo
 */
@Entity
@Table(name = "stlo_tiplocaliz", catalog = "sisventas_db", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tiplocaliz.findAll", query = "SELECT t FROM Tiplocaliz t"),
    @NamedQuery(name = "Tiplocaliz.findByTloCodigo", query = "SELECT t FROM Tiplocaliz t WHERE t.tloCodigo = :tloCodigo"),
    @NamedQuery(name = "Tiplocaliz.findByTloDescri", query = "SELECT t FROM Tiplocaliz t WHERE t.tloDescri = :tloDescri")})
public class Tiplocaliz implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "tlo_codigo")
    private Integer tloCodigo;
    @Size(max = 25)
    @Column(name = "tlo_descri")
    private String tloDescri;
    @OneToMany(mappedBy = "tloCodigo")
    private List<Localiza> localizaList;

    public Tiplocaliz() {
    }

    public Tiplocaliz(Integer tloCodigo) {
        this.tloCodigo = tloCodigo;
    }

    public Integer getTloCodigo() {
        return tloCodigo;
    }

    public void setTloCodigo(Integer tloCodigo) {
        this.tloCodigo = tloCodigo;
    }

    public String getTloDescri() {
        return tloDescri;
    }

    public void setTloDescri(String tloDescri) {
        this.tloDescri = tloDescri;
    }

    @XmlTransient
    public List<Localiza> getLocalizaList() {
        return localizaList;
    }

    public void setLocalizaList(List<Localiza> localizaList) {
        this.localizaList = localizaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tloCodigo != null ? tloCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tiplocaliz)) {
            return false;
        }
        Tiplocaliz other = (Tiplocaliz) object;
        if ((this.tloCodigo == null && other.tloCodigo != null) || (this.tloCodigo != null && !this.tloCodigo.equals(other.tloCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return tloDescri;
    }
    
}
